package com.zc.datastructure.structure.graph;

import java.util.List;
import java.util.Set;

/**
 * @author: zhuCan
 * @date: 2020/6/27 10:51
 * @description:
 */
public class GraphDecorator<T> implements Graph<T> {

  private Graph<T> graph;

  public GraphDecorator(Graph<T> graph) {
    this.graph = graph;
  }

  @Override
  public void create(List<String> vertex) {
    this.graph.create(vertex);
  }

  @Override
  public void addEdge(Edge<T> edge) {
    this.graph.addEdge(edge);
  }

  @Override
  public List<String> DFS(String start, List<String> vertex) {
    List<String> dfs = this.graph.DFS(start, vertex);
    this.graph.reset();
    return dfs;
  }

  @Override
  public Set<T> DFS(String Start, String end, Set<T> data) {
    Set<T> dfs = this.graph.DFS(Start, end, data);
    this.graph.reset();
    return dfs;
  }

  @Override
  public void reset() {
    this.graph.reset();
  }
}
